<?php
/**
 *
 * @author andrew carlson <andrew@acstudiosllc.com>
 * @version 0.0.1
 * @copyright 2012 ACStudios LLC
 * @package default
 */
 
/**
 * Setup auto loader
 *
 * @package default
 * @author  andrew carlson <andrew@acstudiosllc.com>
 */

/* for dev only, comment out for producton */
ini_set('display_errors', 1);

/* require define statements for miscellaneous configs like database points */
require_once 'include/settings.php';

require_once 'modules/Twig/lib/Twig/Autoloader.php';
Twig_Autoloader::register();

/* setup autoloading of classes */
function __autoload($classname) {
		if (file_exists("modules/".ucfirst($classname)."/$classname.php")) {
			require "include/".ucfirst($classname)."/" . $classname .".php";  // catch things no in model
    } else {
    	$class = 'modules/' . str_replace('\\', '/', $classname) . '.class.php';
		require $class;
    }
}

spl_autoload_register('__autoload');
?>
